package com.mixsmart.web.tag.bean;

import com.mixsmart.utils.StringUtils;
import com.mixsmart.web.tag.enums.BtnPropType;

/**
 * 自定义按钮
 * @author lmq <br />
 * 2016年8月2日
 * @version 1.0
 * @since JDK1.6
 */
public class CustomBtn extends BaseBtn {
	
	protected String title;
	
	protected int width = POP_WIN_WIDTH;
	
	protected String btnIcon = BTN_ICON;
	
	protected String paramName = "id";
	
	/**
	 * 选择类型
	 * none-selected -- 不用选中数据(默认)
	 * one-selected -- 只能选中一条数据
	 * multi-selected -- 多选（一条或一条以上）
	 * @see com.mixsmart.web.tag.enums.BtnPropType.SelectType
	 */
	protected String selectedType = BtnPropType.SelectType.NONE.getValue();
	
	/**
	 * @see com.mixsmart.web.tag.enums.BtnPropType.OpenStyle
	 */
	protected String openStyle = BtnPropType.OpenStyle.OPEN_POP.getValue();
	
	public CustomBtn(String id,String title,String name,String uri) {
		this.id = id;
		this.title = StringUtils.isEmpty(title)?name:title;
		this.name = name;
		this.uri = uri;
	}
	
	public CustomBtn(String id,String title,String name,String uri,String btnIcon) {
		this.id = id;
		this.title = StringUtils.isEmpty(title)?name:title;
		this.name = name;
		this.uri = uri;
		this.btnIcon = btnIcon;
	}
	
	public CustomBtn(String id,String title,String name,String uri,String btnIcon,String selectedType) {
		this.id = id;
		this.title = StringUtils.isEmpty(title)?name:title;
		this.name = name;
		this.uri = uri;
		this.btnIcon = btnIcon;
		this.selectedType = selectedType;
	}
	
	public CustomBtn(String id,String title,String name,String uri,String btnIcon,
			String selectedType,String paramName) {
		this.id = id;
		this.title = StringUtils.isEmpty(title)?name:title;
		this.name = name;
		this.uri = uri;
		this.btnIcon = btnIcon;
		this.paramName = paramName;
		this.selectedType = selectedType;
	}
	
	public CustomBtn(String id,String title,String name,String uri, int width,
			String btnIcon,String selectedType,String btnStyle,String paramName) {
		this.id = id;
		this.title = StringUtils.isEmpty(title)?name:title;
		this.name = name;
		this.uri = uri;
		this.width = width;
		this.btnIcon = btnIcon;
		this.btnStyle = btnStyle;
		this.paramName = paramName;
		this.selectedType = selectedType;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public int getWidth() {
		return width;
	}

	public void setWidth(int width) {
		this.width = width;
	}

	public String getBtnIcon() {
		return btnIcon;
	}

	public void setBtnIcon(String btnIcon) {
		this.btnIcon = btnIcon;
	}

	public String getParamName() {
		return paramName;
	}

	public void setParamName(String paramName) {
		this.paramName = paramName;
	}

	public String getSelectedType() {
		return selectedType;
	}

	public void setSelectedType(String selectedType) {
		this.selectedType = selectedType;
	}

	public String getOpenStyle() {
		return openStyle;
	}

	public void setOpenStyle(String openStyle) {
		this.openStyle = openStyle;
	}

}
